<?php
namespace app\index\model;
use think\Model;
class User extends Model
{
	
	public $user;

	public function initalize()
	{
		//parent::initialize();

	}
	
	//查询
	public function userSelect($where)
	{
		return $this->where($where)->select();
	}
	//用户角色关联多对多查询
	public function userTomanyrole()
	{
		return $this->belongsToMany('urole','grm_user_urole');
	}
	//插入
	public function userInsert($data)
	{
		return $this->save($data);
	}
	//更新
	public function userUpdate()
	{
		return $this->where('id', 1)
->update(['name' => 'thinkphp']);
	}
}